<?php
class OrcCustomer
{
	public $SUBSCRIBER_ID    = '';
	public $CREATION_DATE    = '';
	public $BALANCE 		 = '';
	public $BALANCE_REF 	 = '';
	public $STATUS  		 = '';
	public $PREPAID_CARD_SEQ = '';
	public $CARD_NUMBER 	 = '';
	public $LAST_NAME   	 = '';
	public $FIRST_NAME  	 = '';
	
	public function __construct($subscriber_id)
	{
		$response = EnticeWS::getANISubscriber($subscriber_id);

		$xml	  =  $response;
		
		if(isset($xml->error))
		{
			throw new CDbException(404, (string)$xml->error->errorMessage);
		}
	
		$this->SUBSCRIBER_ID	 = strval($xml->data->row->SUBSCRIBER_ID );
		$this->CREATION_DATE	 = strval($xml->data->row->CREATION_DATE );
		$this->BALANCE  		 = strval($xml->data->row->BALANCE  	 );
		$this->BALANCE_REF  	 = strval($xml->data->row->BALANCE_REF   );
		$this->CARD_NUMBER  	 = strval($xml->data->row->CARD_NUMBER   );
		$this->FIRSTNAME		 = strval($xml->data->row->FIRST_NAME    );
		$this->LASTNAME 		 = strval($xml->data->LAST_NAME 		 );
		$this->PREPAID_CARD_SEQ  = strval($xml->data->PREPAID_CARD_SEQ   );
		$this->STATUS   		 = strval($xml->data->STATUS			 );
	}	
}